package file.day9_16.homework;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws IOException {
        File file;
        String input;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入文件名:");
        do{
            input = String.valueOf(scanner.nextLine());
            file = new File("./"+input);
            if(file.exists()){
                System.out.println("已存在,请输入文件名:");
            }
        }while (file.exists());
        file.createNewFile();
        System.out.println("创建成功");
    }
}
